UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'fh1XZDkTuHREkJ/2o152YiZm/iWj/pwTbmQlUJcoC9Q='
WHERE
key_id = '9d7578d558e402e4ba6ab9781d5f9991c91d72d091db20b90f4126eca2edb991'
AND (
token = 'fh1XZDkTuHREkJ/2o152YiZm/iWj/pwTbmQlUJcoC9Q='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)