UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'aEqjiADMGuI0pzo58DQZXbFaQH9oPIzT+XCzyglq1/Y=' 
WHERE 
  key_id = '010d3f9062b6b93005d97eef94323bc82fb4add859b83aae649d6dbce984efb7' 
  AND (
    token = 'aEqjiADMGuI0pzo58DQZXbFaQH9oPIzT+XCzyglq1/Y=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034