UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'UjJVVO9V8yQ2K5aYnlgXYjmvT0oNIgffXBxUoy5jhEE='
WHERE
key_id = '9d93a20ff7c1c6c128d22efc043c712e68c85e3096dceb98d2ea595279fc056e'
AND (
token = 'UjJVVO9V8yQ2K5aYnlgXYjmvT0oNIgffXBxUoy5jhEE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)