UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '5YIWvhmzlOx0q/u4+54NQZG6vuXQpnfdOY+XXuadqwI='
WHERE
key_id = 'a283e462dfe8be873afca89809781f54fee7193b1e487e4b6cf81e491c980dcb'
AND (
token = '5YIWvhmzlOx0q/u4+54NQZG6vuXQpnfdOY+XXuadqwI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)