UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'WlubvE9uK9rDiRmH3AIXVX79mFrTaAxHg27Wm7QUrSE='
WHERE
key_id = '5b5cf80b6bc65b28dd66e40a966b62907f087a6bf29d13c903cc9544c8bf408b'
AND (
token = 'WlubvE9uK9rDiRmH3AIXVX79mFrTaAxHg27Wm7QUrSE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)