UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'e5uAdTOXoBKG8VKbXLYs9Uog5kbR14ZNPmNn2t6vbLA=' 
WHERE 
  key_id = '56dbbd6702663d9363dbc2532805c620b231b18ae39fdd6a9600b4ff2f5db2e9' 
  AND (
    token = 'e5uAdTOXoBKG8VKbXLYs9Uog5kbR14ZNPmNn2t6vbLA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034