UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '5nLyLifxM6XnJLcMKy+rKaz2P2RzDOQdLR7NGcwrOFM='
WHERE
key_id = 'd35d157610de2332c72710dab0dc3a1a30a5332049a6fef6d2d45ba4bada5ea5'
AND (
token = '5nLyLifxM6XnJLcMKy+rKaz2P2RzDOQdLR7NGcwrOFM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)