UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'm9+vaxctvVqmkSAqSq6oqiCR1cITT0iJfBc7Ud+ZoT0='
WHERE
key_id = '6138a1f2d0fee1a98838a2b63e2dc783e67abf0bdcc05700601899029eb65a76'
AND (
token = 'm9+vaxctvVqmkSAqSq6oqiCR1cITT0iJfBc7Ud+ZoT0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)