UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'X5ZARfNl0Vu336AaOZ7iyjL7JAvS0WsP3R5qpGJKNYA='
WHERE
key_id = '74ec3a30401ea384b60fdf0ed6c872c68c20ed833847b28046d0e500d4a02eee'
AND (
token = 'X5ZARfNl0Vu336AaOZ7iyjL7JAvS0WsP3R5qpGJKNYA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)