UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Ga0d9F0VEhZCy1lIhp09eThloQKgekC3ZXQsUJAQdAg='
WHERE
key_id = '2d662c7ce091a5b2344013cb3a58caa375b08ffef0a385953ba2d445ff2abe43'
AND (
token = 'Ga0d9F0VEhZCy1lIhp09eThloQKgekC3ZXQsUJAQdAg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)