UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '3UJlNgcMNLKRAEanjvCl5b2S/HhkFdX+gFN/DwIavpc=' 
WHERE 
  key_id = 'e541d29131ca89472cca3cc1bcc9dffed1010879d2f1ab75c36c17e995be9fad' 
  AND (
    token = '3UJlNgcMNLKRAEanjvCl5b2S/HhkFdX+gFN/DwIavpc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00040