UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '/7RItX2xs0j8ZZ53nT4ZTsEHzrOU06hCGb0mmWAg3n4='
WHERE
key_id = 'e83e14e35c9bf5efdfad1b9657cf0fa237941ad77d7a39e81a641dd2c924c23d'
AND (
token = '/7RItX2xs0j8ZZ53nT4ZTsEHzrOU06hCGb0mmWAg3n4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)