UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'vbskdjaGscAw/Fdh8xIUM0RkE5XFPtwLWhgOvHcfe40='
WHERE
key_id = 'be51701462255d08f5d1d0d9c5e8add9af963c65f52c5bfefa1b89b47f42627a'
AND (
token = 'vbskdjaGscAw/Fdh8xIUM0RkE5XFPtwLWhgOvHcfe40='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)