UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'pJpI91V/jCIW0E/6hjVXaeZ5zxcFveBOCSXGP/C2M08='
WHERE
key_id = '3843f0308b210e2449346a78552a5c858ebc5537947fe6e5cdc20c1f28a99766'
AND (
token = 'pJpI91V/jCIW0E/6hjVXaeZ5zxcFveBOCSXGP/C2M08='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)