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

Query time 0.00034