UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'PI7xHJVE2C3yBwirWigIOnbNLR0AlaRevbtcVLRHSnQ=' 
WHERE 
  key_id = '062e72a1f64837827f97db1b89c844688e64d2cd8cb0137d1ab05c7ac2a1543f' 
  AND (
    token = 'PI7xHJVE2C3yBwirWigIOnbNLR0AlaRevbtcVLRHSnQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00044