UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ArovNx+qZZ9/weCGFbBh294gt2LOGQIY+FiaOPS/HFM='
WHERE
key_id = 'd28c6fe5acd0917ff9c89842ec44c1fd8d274d104d4dee250e18419f10a706d9'
AND (
token = 'ArovNx+qZZ9/weCGFbBh294gt2LOGQIY+FiaOPS/HFM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)