UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '3YHMP66V4vcrM+R1ltdlCoBiIO5PElQZFVP2y130v3o='
WHERE
key_id = '206856464a426578aeb9197322dd4f7ccc2cfc6a22fcb385bd5c615c4c0694eb'
AND (
token = '3YHMP66V4vcrM+R1ltdlCoBiIO5PElQZFVP2y130v3o='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)