UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'qYl20jZHTUgporq35Xgp49+yHHq823Wvz3Q/gP8Ww5U='
WHERE
key_id = '3acab579f5741f5e8b7903b83b61f71cb3d9f9466ffb4aa2eaef87bdd8cb36b1'
AND (
token = 'qYl20jZHTUgporq35Xgp49+yHHq823Wvz3Q/gP8Ww5U='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)