UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'je7X4Z+5SryOGyAZWawsYnpa30wgyz4LWVcWUdf7Tgk='
WHERE
key_id = '97663a95884b4463f1dfd30f1fae85f66f2e62c2c964f4a3d13f3e619f73a36a'
AND (
token = 'je7X4Z+5SryOGyAZWawsYnpa30wgyz4LWVcWUdf7Tgk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)