UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'fT+9ydSAvi4o5PrSdwF3awS+/dAM/IaSiJJk1JzJYJQ=' 
WHERE 
  key_id = '8791d558ada5617b48286998cb3368276994acaf9598f3af5a11e004741db1c2' 
  AND (
    token = 'fT+9ydSAvi4o5PrSdwF3awS+/dAM/IaSiJJk1JzJYJQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030