UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'GdOs62SufZrpzTW0BvWgTHD0Ur2liZhFmUxUcoOSg0I='
WHERE
key_id = '1068b4121cf5f386a2bb9fa5d28b6057859e86fdc23ad62b31522deda80f8094'
AND (
token = 'GdOs62SufZrpzTW0BvWgTHD0Ur2liZhFmUxUcoOSg0I='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)