UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'uTRecfUWpjpQQzA+OU1XDg+MPJAYyB+u6hukElh8OIo=' 
WHERE 
  key_id = '1e8f5d61860a795379534d14b91c5b1324dfbb4fa5025401e841b2fe0c57df40' 
  AND (
    token = 'uTRecfUWpjpQQzA+OU1XDg+MPJAYyB+u6hukElh8OIo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035