UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'PfHdsaHprXsUiJCe1wchlx5CLBaBskDoZDHzHjEoBkM='
WHERE
key_id = 'dd783bd0923d9f546861fcc4023aca902c1d04884874e911bfebbdcf0b97170e'
AND (
token = 'PfHdsaHprXsUiJCe1wchlx5CLBaBskDoZDHzHjEoBkM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)