UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Rv7Ryfre0YHMFv+3BJlUuHWPaBWIQGjzXfn2pIOgnZ0=' 
WHERE 
  key_id = 'bcb6dce1eab9d7d3513291b50778dbf2a0ca6d9b00c167dcaada3af7ee1278a6' 
  AND (
    token = 'Rv7Ryfre0YHMFv+3BJlUuHWPaBWIQGjzXfn2pIOgnZ0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00037