UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'HWl/aglbHeSnb953FfMvC3R8HTCieG8h2awG2KoThZA=' 
WHERE 
  key_id = '365e98ae5567c104cf21775be2fd257dd743178c26e4bd98d34928847b06354a' 
  AND (
    token = 'HWl/aglbHeSnb953FfMvC3R8HTCieG8h2awG2KoThZA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00016