UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'WzHmzFcb80TjdIhqGzJMVCMFUzHKmbtCRz975+dfhic='
WHERE
key_id = '1eaeefbb0b181ab89c5227ee63d5f2000cb3a091346cc3a3042f7bf65e588ce0'
AND (
token = 'WzHmzFcb80TjdIhqGzJMVCMFUzHKmbtCRz975+dfhic='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)