UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'UqwOVXotGPk3KBM64GMp+ni1DipSLfd5iZXi623Jitc='
WHERE
key_id = '42b2e08da479d9ee9436f488b8bc93e5c339147525712330c49ccc7927cd3da0'
AND (
token = 'UqwOVXotGPk3KBM64GMp+ni1DipSLfd5iZXi623Jitc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)