UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'C8n8b6fyXNg1e0V/kcDZsXyB+pvg1mnFNlaE8Zoou3Q=' 
WHERE 
  key_id = '70d8e51a17a40f6b558a73ce80e7ad7067771b66b85e6fe196d513d650a65cbf' 
  AND (
    token = 'C8n8b6fyXNg1e0V/kcDZsXyB+pvg1mnFNlaE8Zoou3Q=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00060