UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'UjOi5I+WrpKr/poh0ux9dmwEV7iGpEwfvWFZtVKf+L4='
WHERE
key_id = 'd3e09d8bba10e13cff176d1fdf95c882ed680a61907db60c58c918d30a18d5b4'
AND (
token = 'UjOi5I+WrpKr/poh0ux9dmwEV7iGpEwfvWFZtVKf+L4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)