UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'RKiAMXTs72647elP7YXE9DIKMWoD6Sj0RjPVG7myegA='
WHERE
key_id = 'de1b8f827b1b526194f7407527352e2d3dd9bddb2294901c221bbaa613082458'
AND (
token = 'RKiAMXTs72647elP7YXE9DIKMWoD6Sj0RjPVG7myegA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)