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