UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'rT2FGXgpASaShIhLScrudURJvOGGeGR8D9DQcmZtKy4='
WHERE
key_id = '9681ed949f4c71021fd5bebc9d875733f377d7aba58491183289bc491ec8454c'
AND (
token = 'rT2FGXgpASaShIhLScrudURJvOGGeGR8D9DQcmZtKy4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)