UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'jJsQNtzvtnj7jbFGUQ8hIFRy/K/e5Ime9tucFd5UeDQ='
WHERE
key_id = '5c05167eb794a083a8742b6ae5e618ddd273c44035345a689f7f9de1790d68ec'
AND (
token = 'jJsQNtzvtnj7jbFGUQ8hIFRy/K/e5Ime9tucFd5UeDQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)