UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'jAm/QHImreK5yv6VqknUeZ+XsAZlGyU+nje7qAJGJqs='
WHERE
key_id = '071f96c33c7390cf7fde1f79bf15c301ea24ccc9a7e6d38104cc278ae3036c21'
AND (
token = 'jAm/QHImreK5yv6VqknUeZ+XsAZlGyU+nje7qAJGJqs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)