UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '/kOyM4NDXxDy8KSB2FUxpLHcg7uJEZ8i1cu0dMrN1g4='
WHERE
key_id = 'df1532261e31d39dfef1ac6fcf9c6afdba0199d2afd9ff0da30812b03b16bfc4'
AND (
token = '/kOyM4NDXxDy8KSB2FUxpLHcg7uJEZ8i1cu0dMrN1g4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)