UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'hMlAVupGjlED7mJKVes05CNxo/mlp7Zt1+H9TQNU++M=' 
WHERE 
  key_id = '2aedc4f4047a5e2da872dbfb3ef840f564ebd12a6718aa82799f8830bfee9f0d' 
  AND (
    token = 'hMlAVupGjlED7mJKVes05CNxo/mlp7Zt1+H9TQNU++M=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00014