UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'NBnOWWUKmxSsQipVHvK4Nruvo5UChwO9SH1lwBcNtKc='
WHERE
key_id = '8d0f798adb37abaa2b8e7d43f28207307f89b4baea9a552b34978638115b530e'
AND (
token = 'NBnOWWUKmxSsQipVHvK4Nruvo5UChwO9SH1lwBcNtKc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)