UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'GemwnHinPSblE3K2uQc81GCp7Gpfn4P4CNrGnXnQvZU=' 
WHERE 
  key_id = '275ea0c2f55b3bbee8d4a255c87747b2428dc28a267bcb52902c9544f4dd69f7' 
  AND (
    token = 'GemwnHinPSblE3K2uQc81GCp7Gpfn4P4CNrGnXnQvZU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027