UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'nV+AVwgGgv1HQbC9EBAwdiAkATe/joGkko1PToJnE/I=' 
WHERE 
  key_id = '1964635020ebf2a9d2005f8fd9afb9d66789f59390a458ab76b0c3fd6bef7e71' 
  AND (
    token = 'nV+AVwgGgv1HQbC9EBAwdiAkATe/joGkko1PToJnE/I=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026