UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '9lBhYAsib58asEhgx0UUTt3foEoOPHOUnVmbu51/rMg=' 
WHERE 
  key_id = '1a353dba4e8982406bfda24812e2e35e9f075ab6fc44f0eaeccfd477e716ae3c' 
  AND (
    token = '9lBhYAsib58asEhgx0UUTt3foEoOPHOUnVmbu51/rMg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00024