UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '9Il+OUiJB3Xbtk8dsElo6h41GSz73vd+iFYd5RJzTv4='
WHERE
key_id = '9c7b7a28c31592b2580d81e91cd8dfe167aef2e24f3c7a7e0046eef0ddbb527d'
AND (
token = '9Il+OUiJB3Xbtk8dsElo6h41GSz73vd+iFYd5RJzTv4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)