UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '2Fkg3J5WHClfqvUup3gAf4ZSJlYhmLTUKTqI54+/Z2g='
WHERE
key_id = 'bd3ef604ee0f87c0c0b8ce5947ac18786b6c79afa0f38a26e268044ee49feb94'
AND (
token = '2Fkg3J5WHClfqvUup3gAf4ZSJlYhmLTUKTqI54+/Z2g='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)