UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'NfWDv9w7qZE3O/fNJnixkrGBCU1N85mM2I0qynP8nMU='
WHERE
key_id = '83cdf758d9541405e6d3928135fcad179cbce3542cffb632c42d73813ebd7d06'
AND (
token = 'NfWDv9w7qZE3O/fNJnixkrGBCU1N85mM2I0qynP8nMU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)