UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'rA/Kr0Qn7CmffpCV9Yv+YmjllN3yui2WnBrdpjTSkxs='
WHERE
key_id = '7db084ee5fdb22786a1929dbc44ef05bd815359831a1d186b43759df268f7fb0'
AND (
token = 'rA/Kr0Qn7CmffpCV9Yv+YmjllN3yui2WnBrdpjTSkxs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)