UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'XWCmTufL6CpMqmwg7lEO5WbBZghTZMit8nchF0XX7kI=' 
WHERE 
  key_id = '00158efbaf8472fad02655e4467f08a75382d8556ff76722f65d4f7aa4129552' 
  AND (
    token = 'XWCmTufL6CpMqmwg7lEO5WbBZghTZMit8nchF0XX7kI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025