UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ICKlxnk0pEMp57wpzdpxmobSuFisdLaxdusIV0EOArI=' 
WHERE 
  key_id = 'db06ed9c56ed2fdc076acdfa6ebabe332c4df4c00c0713a2773fda5c45c8bbea' 
  AND (
    token = 'ICKlxnk0pEMp57wpzdpxmobSuFisdLaxdusIV0EOArI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00044