UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Om/RliSeWBSj7ZrL7aF3Grn/uFYbOaYgMQ25rZ0rXYs=' 
WHERE 
  key_id = 'eba8b999ffe2e2de2e55dc09f1b0067ce76eff4bde91fc1aec13eeca31488eba' 
  AND (
    token = 'Om/RliSeWBSj7ZrL7aF3Grn/uFYbOaYgMQ25rZ0rXYs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025